import request from '@/utils/request.js'
import store from '../store'
// 用户登录
export const LoginAPI = ({ username, password }) => {
  return request({
    url: '/user/login',
    method: 'POST',
    data: {
      username, password
    }
  })
}
// 找房数据
export const SearchAPI = ({ cityId, stat, end }) => {
  return request({
    url: '/houses',
    headers: {
      Authorization: 'authorization ' + store.state.token
    },
    params: {
      cityId: '',
      stat: stat,
      end: end
    }
  }
  )
}
// 城市列表
export const cityAPI = ({ level }) => {
  return request({
    url: '/area/city',
    params: {
      level: level
    }
  })
}
export const cityhotAPI = () => {
  return request({
    url: '/area/hot'

  })
}
// 区域下拉菜单
export const LoacalAPI = ({ value }) => {
  return request({
    url: '/houses/condition',
    params: {
      id: value
    }
  })
}
// 轮播图
export const Swipter = () => {
  return request({
    url: '/home/swiper'

  })
}
